jQuery.massuploadcreate = function(){
    var id = $("#upid").attr('value');
    if (id) {
        id++;
        var html = '<div id="upload-input-' + id + '">';
        html+= '<div class="work-upload-title">' + all_image + ' <a class="topnolink" href="javascript:$.massuploadremove(\'' + id + '\');">x</a></div>';
        html+= '<dl>';
        html+= '<dt>' + all_file + ' :</dt>';
        html+= '<dd>';
        html+= '<input name="files[]" size="40" type="file" onchange="$.massuploadcreate()">&nbsp;';
        html+= '<select name="miniature[]">';
        html+= '<option value="yes">' + miniature_yes + ' : ' + all_yes + '</option>';
        html+= '<option value="no">' + miniature_yes + ' : ' + all_no + '</option>';
        html+= '</select>';
        html+= '</dd>';
        html+= '</dl>';
        html+= '<dl>';
        html+= '<dt>' + all_width + ', ' + all_height + ' :</dt>';
        html+= '<dd>';
        html+= '<select name="width[]">' + size + '</select>&nbsp;';
        html+= '<select name="height[]">' + size + '</select>&nbsp;';
        html+= '<select name="resize[]">';
        html+= '<option value="yes">' + all_resize + ' : ' + all_yes + '</option>';
        html+= '<option value="no">' + all_resize + ' : ' + all_no + '</option>';
        html+= '</select>';
        html+= '</dd>';
        html+= '</dl>';
        html+= '<dl>';
        html+= '<dt>' + all_name + ' :</dt>';
        html+= '<dd>';
        html+= '<input type="text" name="names[]" size="40" value="" maxlength="255">';
        html+= '</dd>';
        html+= '</dl>';
        html+= '<dl>';
        html+= '<dt>' + all_decs + ' :</dt>';
        html+= '<dd>';
        html+= '<input type="text" name="desc[]" size="40" value="" maxlength="255">';
        html+= '</dd>';
        html+= '</dl>';
        html+= '<dl>';
        html+= '<dt>' + image_alt + ' :</dt>';
        html+= '<dd>';
        html+= '<input type="text" name="alt[]" size="40" value="" maxlength="255">';
        html+= '</dd>';
        html+= '</dl>';
        html+= '</div>';
        $("form[name=total-form] #upload-area").append(html);
        $("form[name=total-form] #upload-area #upload-input-" + id).show('normal');
        $("#upid").attr({value:id});
    }
}

jQuery.massuploadremove = function(id){
    $("form[name=total-form] #upload-area #upload-input-" + id).remove();
}